

package com.hazelcast.access.impl;

import com.hazelcast.access.AccessControlService;
import com.hazelcast.access.AuthenticationContext;
import com.hazelcast.access.AuthorizationContext;

import javax.security.auth.login.LoginException;

public class NoOpAccessControlService implements AccessControlService {

    public static final NoOpAccessControlService INSTANCE = new NoOpAccessControlService();
    private static final String[] ROLES = new String[0];

    private NoOpAccessControlService() {
    }

    @Override
    public String[] authenticate(AuthenticationContext ctx) throws LoginException {
        return ROLES;
    }

    @Override
    public boolean isAccessGranted(AuthorizationContext ctx, String... assignedRoles) {
        return true;
    }

}
